package main

import (
	"context"
	"fmt"
	"time"

	"gitlab.ctyun.cn/ctg-dcos/workflow-sdk-go/pkg/client"
	"gitlab.ctyun.cn/ctg-dcos/workflow-sdk-go/pkg/openapi"
)

func main() {
	cli := openapi.NewCloudFlowClient("cf.fc-xinan1.ctyun.cn",
		"Your-AK", "Your-SK",
		client.WithTimeout(60*time.Second),
		client.TlsInsecureSkipVerify())

	resp := cli.InvokeWorkflow(context.Background(), "200000002368", &openapi.InvokeFlowRequest{
		WorkflowName:  "newv",
		Input:         "{\"a\":1}",
		ExecutionName: "aaa",
	})

	if resp.Error != nil {
		fmt.Printf("resp err:%v", resp.Error)
	} else {
		fmt.Printf("resp:%s", string(resp.Body))
	}
}
